package com.ychen.usercenter.controllers;

import com.ychen.usercenter.api.UserInfoFacade;
import com.ychen.usercenter.dao.UserInfoMapper;
import com.ychen.usercenter.entity.UserInfo;
import com.ychen.usercenter.vo.UserInfoVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class UserInfoController implements UserInfoFacade {

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public UserInfoVo getUserInfoByUserId(Long userId) {
        UserInfo userInfo = userInfoMapper.selectByPrimaryKey(userId);
        UserInfoVo vo = new UserInfoVo();
        BeanUtils.copyProperties(userInfo, vo);
        return vo;
    }
}
